package com.crm.repository;

import com.crm.entity.Role;
import com.crm.entity.User;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;

public interface RoleRepository extends JpaRepository<Role,Integer> {

    //public Role findRoleByUsers(User user);

    /**
     * 根据角色名称进行模糊查询并分页
     * @param roleName
     * @return
     */
    public Page<Role> findRolesByRoleNameLike(String roleName, Pageable pageable);


    public Role findRolesByUsers(User user);
}
